package com.forekonw.demo8;

/**
 * 单例模式
 * 1.私有构造器
 */
public class SingleDemo {
    private String name;
    private static SingleDemo instance = new SingleDemo();

    public static SingleDemo getInstance() {
        return instance;
    }


    private SingleDemo(){

    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
